package cn.com.eado.crm.m.db

import androidx.lifecycle.LiveData
import androidx.room.*


@Dao
interface ProvinceDao {
    @Insert//(onConflict = OnConflictStrategy.REPLACE)
    fun insert(province: Province)

    @Insert//(onConflict = OnConflictStrategy.REPLACE)
    fun insertAll(provinces: List<Province>)

//    @Insert(onConflict = OnConflictStrategy.REPLACE)
//    fun replaceAll(provinces: List<Province>)

//    @Insert(onConflict = OnConflictStrategy.REPLACE)
//    fun replace(province: Province)

//    @Delete
//    fun delete(province: Province)

//    @Update
//    fun update(province: Province)

    @Query("select * from province")  //查询所有
    fun queryAll(): List<Province>?

    @Query("select * from province where provinceName = :provinceName")  //查询所有
    fun queryCity(provinceName: String): Province?

}